import json

def dualData(path):

    # 读取json文件每一行一输出
    json_file = open(path, "r", encoding='utf-8')
    li = []
    for line in json_file:
        x  = json.loads(line)
        li.append(x)
    print(li)
    # 将list以utf-8形式存储到x.json中
    with open("./data/med_zh/y.json", "w", encoding='utf-8') as f:
        json.dump(li, f, ensure_ascii=False)
    
    
if __name__ == "__main__":
    dualData()